﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="mailsend.aspx.cs" ValidateRequest="false" Inherits="Basic_mailsend" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
   <title>写消息</title>
   <link rel="stylesheet" type="text/css" href="../CSS/Style.css"/>
   <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
   <script type="text/javascript" src="../xheditor/xheditor-zh-cn.min.js"></script>
   <script type="text/javascript">
     function getTname(){
     $("#contactlist").toggle();
     } 
     function check(){
        if($("#txtReceiver").val()==""){
           $("#errortip").text("收件人不能为空！");
           $("#errortip").css("color","red");
          return false; 
        }
         if($.trim($("#txtTitle").val())==""){
           $("#errortip").text("消息标题不能为空！");
           $("#errortip").css("color","red");
           $("#txtTitle").focus(); 
          return false; 
        }
         if($.trim($("#txtcontent").val())==""){
           $("#errortip").text("消息内容不能为空！");
           $("#errortip").css("color","red");
           $("#txtcontent").focus(); 
          return false; 
        }
        else
           return true;
     }
     function reset(){
         $("#txtTitle").val("");
         $("#txtcontent").val("");
     }
  </script> 
  <style type="text/css">
  h2{
  margin-top:-45px;
  padding-left:90px;
  color:#77ac98;
  }
  </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="padding-left:30px;">
        <div><img src="../Images/email.png" alt="发件箱" /><h2>写消息</h2></div> 
        <div> 
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <table>
            <tr>
                <td style="text-align:right;">消息类型：</td>
                <td style="text-align:left;">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:DropDownList ID="ddlType" runat="server" OnSelectedIndexChanged="ddlType_SelectedIndexChanged" AutoPostBack="True">
                    <asp:ListItem Value="1">普通消息</asp:ListItem>
                    <asp:ListItem Value="2">学院消息</asp:ListItem>
                    <asp:ListItem Value="3">项目消息</asp:ListItem>
                    <asp:ListItem Value="4">系统消息</asp:ListItem>
                </asp:DropDownList>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td style="text-align:right;"><a href="javascript:getTname()">收件人</a>：</td>
                <td style="text-align:left">
                    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                        <ContentTemplate>
                            <asp:HiddenField ID="HiddenField1" runat="server" />
                            <asp:TextBox ID="txtReceiver" runat="server" Width="525px" MaxLength="32" ReadOnly="True"></asp:TextBox>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr id="contactlist" style="display:none;">
                <td style="text-align:right;">联系人：</td>
                <td style="text-align:left">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:DropDownList ID="ddlCollege" runat="server" Width="150px" OnSelectedIndexChanged="ddlCollege_SelectedIndexChanged" AutoPostBack="True">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlTname" runat="server" Width="80px" OnSelectedIndexChanged="ddlTname_SelectedIndexChanged" AutoPostBack="True">
                            </asp:DropDownList>&nbsp;
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr> 
           <tr>
                <td style="text-align:right;">消息标题：</td>
                <td style="text-align:left"><asp:TextBox ID="txtTitle" runat="server" Width="525px"></asp:TextBox></td>
            </tr> 
            <tr>
                <td style="text-align:right; vertical-align:top;">消息内容：</td>
                <td style="text-align:left;">
                    <asp:TextBox ID="txtcontent" runat="server" Height="250px" TextMode="MultiLine" Width="530px" 
                    CssClass="xheditor {tools:'Bold,Italic,Underline,Strikethrough,About',skin:'default'} "></asp:TextBox>
                </td>
            </tr>
           <tr>
               <td></td> 
               <td> <div id="divnote" runat="server" style="background: #FFFCC9;border: 1px solid #FFD667;"><img id="warning"  src="../Images/Warning.png" alt="提示" />
               <span id="errortip">提示：为保证收件人的准确性，请您点击收件人进行选择，暂不支持群发。 </span> </div>
               </td>
           </tr> 
           <tr><td colspan="2" style="text-align:center;">
               <asp:Button ID="btnSubmit" runat="server" Text="发送" OnClick="btnSubmit_Click" OnClientClick="return check();" CssClass="btn-dy-blue" /><input id="btnSet" type="button"
                   value="重置" class="btn-dy-blue" onclick="reset()" /></td></tr> 
        </table>
        </div>
    </div>
    </form>
</body>
</html>
